import $http from '../../../servers/http';
import { Result } from '../../schema/Result';
/* 系统配置-主叫号码管理
---------------------------------------------------------------- */
import { MainNumInfo } from '../../schema/MainNum';
/**新增主叫号码 */
export const createMainNum = (data: MainNumInfo): Promise<any> => {
  return $http.post({
    url: '/icms/callingnumbermanager/callingnumbers',
    data,
  });
};

/**删除主叫号码 */
export const deleteMainNum = (id: number): Promise<Result<null>> => {
  return $http.delete({
    url: `/icms/callingnumbermanager/callingnumbers/${id}`,
  });
};

/**查询主叫号码列表 */
export const getMainNumList = (data: {
  pageSize: number;
  pageNo: number;
  callingNumber?: string;
}): Promise<Result<MainNumInfo[]>> => {
  return $http.get({
    url: '/icms/callingnumbermanager/callingnumbers',
    data,
  });
};
